<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php
	echo form_fieldset($title,array('class' => 'adminview'));
	echo anchor('admin','Kembali');
	$this->table->set_heading(array(
					'#',
					'Nama PT',
					'Nama Tim',
					'Nama Anggota', 
					'No HP',
					'Email',
					'Pembimbing',
					'Syarat',
					'Valid',
					'Finalis',
					'Kaos',
					'Edit',
					));
	$temp=' <col width="20"/>
			<col width="100"/>
			<col width="100"/>
			<col width="250"/>
			<col width="100"/>
			<col width="100"/>
			<col width="120"/>
			<col width="150"/>
			<col width="30"/>
			<col width="30"/>
			<col width="30"/>
			<col width="30"/>
			';
	// }
	$tmpl = array (
                    'table_open'          => '<table id="itbpc_table">'.$temp,
                    'row_alt_start'       => '<tr class="alt" >',
              );

	$this->table->set_template($tmpl); 

	foreach($data as $row) {
		$rrow = array(
			(sprintf('SPC%03d',$row->spc_no_tim)).'<br>'.$row->spc_waktudaftar,
			$row->spc_nama_pt,
			$row->spc_nama_tim,		
			"<ol class='anggota'>
					<li>{$row->spc_nama_1}</li>
					<li>{$row->spc_nama_2}</li>
					<li>{$row->spc_nama_3}</li>
					</ol>",
			$row->spc_nohp,
			$row->spc_email,
			$row->spc_pembimbing,
			('<ol class="anggota">
			<li>KTM1 : '.
				($row->spc_link_ktm1==''?'-':anchor_popup(base_url().$row->spc_link_ktm1,'link')).'</li>
			<li>KTM2 : '.
				($row->spc_link_ktm2==''?'-':anchor_popup(base_url().$row->spc_link_ktm2,'link')).'</li>
			<li>KTM3 : '.
				($row->spc_link_ktm3==''?'-':anchor_popup(base_url().$row->spc_link_ktm3,'link')).'</li>
			<li>bayar : '.
				($row->spc_link_buktibayar==''?'-':anchor_popup(base_url().$row->spc_link_buktibayar,'link')).'</li>
			</ol>'),
			$this->sam->_image_bol($row->spc_valid,'valid', 'tidak valid','20','20'),
			$this->sam->_image_bol($row->spc_finalis,'finalis', 'bukan finalis','20','20'),
			'<ul class="kaos">
				<li>'.($row->spc_kaos_1==''?'-':$row->spc_kaos_1).'</li>
				<li>'.($row->spc_kaos_2==''?'-':$row->spc_kaos_2).'</li>
				<li>'.($row->spc_kaos_3==''?'-':$row->spc_kaos_3).'</li>
			</ol></div>',
			anchor(
				'admin/edit_spc/'.$row->spc_no_tim,
				img (array(
					'src' => 'images/edit.png',
					'alt' => 'Edit',
					'class' => 'center',
					'width' => '20',
					'height' => '20',
					'title' => 'Edit Kontestan ini',
					))),
		);
		$this->table->add_row($rrow);
	}
	echo $this->table->generate();


echo form_fieldset_close(); 


